# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=nettle

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.7.1
pkgrel=3
pkgdesc="A low-level cryptographic library (mingw-w64)"
arch=('any')
url="http://www.lysator.liu.se/~nisse/nettle"
license=("LGPL")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config")
depends=("${MINGW_PACKAGE_PREFIX}-gmp")
options=('staticlibs' 'strip')
source=("http://www.lysator.liu.se/~nisse/archive/nettle-$pkgver.tar.gz")
md5sums=('003d5147911317931dd453520eb234a5')

build() {
    mkdir -p "${srcdir}/${_realname}-${pkgver}-build-${CARCH}"
    cd "${srcdir}/${_realname}-${pkgver}-build-${CARCH}"
    "${srcdir}"/${_realname}-${pkgver}/configure \
        --prefix=${MINGW_PREFIX} \
        --build=${MINGW_CHOST} \
        --host=${MINGW_CHOST} \
        --target=${MINGW_CHOST} \
        --enable-shared \
        --enable-public-key
    make -j1
}

package() {
    cd "${srcdir}/${_realname}-${pkgver}-build-${CARCH}"
    make -j1 DESTDIR="$pkgdir" install
}
